
*===================================================*
*													*
*		Last Update: 2015_05_25						*
*													*
*===================================================*
clear all
set mem 50m
* cd "..."
use "DATA_COMPILED_ATOP_20151118.dta"
set more off 

label var interaction "Troops $\times$ Troops Spatial Mean"
label var meanregionalallies "Host-State Allies (Spatial Mean)"
label var meanregionalusallies "US Allies (Spatial Mean)"
label var movav3_sp "MIDs (Spatial Mean)"

*No Germany and Japan tests
xtset ccode year
set more off
eststo clear
#delimit ;
	//	All States
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity l.growth 
	l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if year<2004 & ccode!=255 & ccode!=260 & ccode!=740, corr(ar1) pairwise ;	
	// 	Non-NATO US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates 
	civilwar l.meanregionalallies l.meanregionalusallies if usally == 1 & NATO == 0 
	& year<2004 & ccode!=255 & ccode!=260 & ccode!=740, corr(ar1) pairwise ;
	//	NATO Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if NATO == 1 & year<2004 & ccode!=255 & ccode!=260 & ccode!=740, 
	corr(ar1) pairwise;
	// 	Non-US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if usally ==0 & year<2004 & ccode!=255 & ccode!=260 & ccode!=740, 
	corr(ar1) pairwise ;

#delimit ;
esttab _all using Appendix_Table_1_20150523.tex, replace 
	mtitles("All States" "Non-NATO Allies" "NATO Allies" "Non-Allies")  
	scalars("p Prob $ > \chi^2$") se(3) b(3) r2 obslast label se nogaps 
	star(* 0.10 ** 0.05 *** 0.01)  
	wide
	nogaps
	order(L.lntroops L.lntroops_spmean L.interaction L.spatial_lag 
		L.meanregionalallies L.meanregionalusallies L.spatial_lag L.polity2 L.growth L.lntpop  
		L.IMR war civilwar movav3 L.threat_environment) 
	compress 
	nonotes 
	addnote("Panel-corrected standard errors in parentheses. Two-tailed significance tests used." "$*$ 
		p$\leq$ 0.10; $**$ p$\leq$ 0.05; $***$ p$\leq$0.01") 
		substitute(L.  ) ;		
	
	#delimit cr




* Cold War Only
clear all
set mem 50m
* cd "..."
use "DATA_COMPILED_ATOP_20151118.dta"
set more off 

label var interaction "Troops $\times$ Troops Spatial Mean"
label var meanregionalallies "Host-State Allies (Spatial Mean)"
label var meanregionalusallies "US Allies (Spatial Mean)"

xtset ccode year
set more off
eststo clear
#delimit ;
	//	All States
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity l.growth 
	l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if year<1991, corr(ar1) pairwise ;	
	// 	Non-NATO US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates 
	civilwar l.meanregionalallies l.meanregionalusallies if usally == 1 & NATO == 0 
	& year<1991, corr(ar1) pairwise ;
	//	NATO Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if NATO == 1 & year<1991, 
	corr(ar1) pairwise;
	// 	Non-US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if usally ==0 & year<1991, 
	corr(ar1) pairwise ;

#delimit ;
esttab _all using Appendix_Table_2_20150729.tex, replace 
	mtitles("All States" "Non-NATO Allies" "NATO Allies" "Non-Allies")  
	scalars("p Prob $ > \chi^2$") se(3) b(3) r2 obslast label se nogaps 
	star(* 0.10 ** 0.05 *** 0.01)  
	wide
	nogaps
	order(L.lntroops L.lntroops_spmean L.interaction L.spatial_lag 
		L.meanregionalallies L.meanregionalusallies L.spatial_lag L.polity2 L.growth L.lntpop  
		L.IMR war civilwar movav3 L.threat_environment) 
	compress 
	nonotes 
	addnote("Panel-corrected standard errors in parentheses. Two-tailed significance tests used." "$*$ 
		p$\leq$ 0.10; $**$ p$\leq$ 0.05; $***$ p$\leq$0.01") 
		substitute(L.  ) ;		
	
	#delimit cr


* Post-Cold War Only
clear all
set mem 50m
* cd "..."
use "DATA_COMPILED_ATOP_20151118.dta"
set more off 

label var interaction "Troops $\times$ Troops Spatial Mean"
label var meanregionalallies "Host-State Allies (Spatial Mean)"
label var meanregionalusallies "US Allies (Spatial Mean)"

xtset ccode year
set more off
eststo clear
#delimit ;
	//	All States
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity l.growth 
	l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if year>=1991, corr(ar1) pairwise ;	
	// 	Non-NATO US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates 
	civilwar l.meanregionalallies l.meanregionalusallies if usally == 1 & NATO == 0 
	& year>=1991, corr(ar1) pairwise ;
	//	NATO Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if NATO == 1 & year>=1991, 
	corr(ar1) pairwise;
	// 	Non-US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if usally ==0 & year>=1991, 
	corr(ar1) pairwise ;

#delimit ;
esttab _all using Appendix_Table_3_20150729.tex, replace 
	mtitles("All States" "Non-NATO Allies" "NATO Allies" "Non-Allies")  
	scalars("p Prob $ > \chi^2$") se(3) b(3) r2 obslast label se nogaps 
	star(* 0.10 ** 0.05 *** 0.01)  
	wide
	nogaps
	order(L.lntroops L.lntroops_spmean L.interaction L.spatial_lag 
		L.meanregionalallies L.meanregionalusallies L.spatial_lag L.polity2 L.growth L.lntpop  
		L.IMR war civilwar movav3 L.threat_environment) 
	compress 
	nonotes 
	addnote("Panel-corrected standard errors in parentheses. Two-tailed significance tests used." "$*$ 
		p$\leq$ 0.10; $**$ p$\leq$ 0.05; $***$ p$\leq$0.01") 
		substitute(L.  ) ;		
	
	#delimit cr

	
	
	
* Pre War on Terror Years Only
clear all
set mem 50m
* cd "..."
use "DATA_COMPILED_ATOP_20151118.dta"
set more off 

label var interaction "Troops $\times$ Troops Spatial Mean"
label var meanregionalallies "Host-State Allies (Spatial Mean)"
label var meanregionalusallies "US Allies (Spatial Mean)"

xtset ccode year
set more off
eststo clear
#delimit ;
	//	All States
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity l.growth 
	l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if year<=2000, corr(ar1) pairwise ;	
	// 	Non-NATO US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates 
	civilwar l.meanregionalallies l.meanregionalusallies if usally == 1 & NATO == 0 
	& year<=2000, corr(ar1) pairwise ;
	//	NATO Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if NATO == 1 & year<=2000, 
	corr(ar1) pairwise;
	// 	Non-US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if usally ==0 & year<=2000, 
	corr(ar1) pairwise ;

#delimit ;
esttab _all using Appendix_Table_4_20150729.tex, replace 
	mtitles("All States" "Non-NATO Allies" "NATO Allies" "Non-Allies")  
	scalars("p Prob $ > \chi^2$") se(3) b(3) r2 obslast label se nogaps 
	star(* 0.10 ** 0.05 *** 0.01)  
	wide
	nogaps
	order(L.lntroops L.lntroops_spmean L.interaction L.spatial_lag 
		L.meanregionalallies L.meanregionalusallies L.spatial_lag L.polity2 L.growth L.lntpop  
		L.IMR war civilwar movav3 L.threat_environment) 
	compress 
	nonotes 
	addnote("Panel-corrected standard errors in parentheses. Two-tailed significance tests used." "$*$ 
		p$\leq$ 0.10; $**$ p$\leq$ 0.05; $***$ p$\leq$0.01") 
		substitute(L.  ) ;		
	
	#delimit cr

	

* Spatial Mean of MIDs in Neighborhood	
clear all
set mem 50m
* cd "..."
use "DATA_COMPILED_ATOP_20151118.dta"
set more off 

label var interaction "Troops $\times$ Troops Spatial Mean"
label var meanregionalallies "Host-State Allies (Spatial Mean)"
label var meanregionalusallies "US Allies (Spatial Mean)"
label var movav3_sp "MIDs (Spatial Mean)"

// Full Sample
xtset ccode year
set more off
eststo clear
#delimit ;
	//	All States
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity l.growth 
	l.lntpop l.IMR l.threat_environment war movav3 movav3_sp borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if year<2004 , corr(ar1) pairwise ;	
	// 	Non-NATO US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 movav3_sp borderstates 
	civilwar l.meanregionalallies l.meanregionalusallies if usally == 1 & NATO == 0 
	& year<2004, corr(ar1) pairwise ;
	//	NATO Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 movav3_sp borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if NATO == 1 & year<2004 , 
	corr(ar1) pairwise;
	// 	Non-US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 movav3_sp borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if usally ==0 & year<2004 , 
	corr(ar1) pairwise ;

#delimit ;
esttab _all using Appendix_Table_5_20151007.tex, replace 
	mtitles("All States" "Non-NATO Allies" "NATO Allies" "Non-Allies")  
	scalars("p Prob $ > \chi^2$") se(3) b(3) r2 obslast label se nogaps 
	star(* 0.10 ** 0.05 *** 0.01)  
	wide
	nogaps
	order(L.lntroops L.lntroops_spmean L.interaction L.spatial_lag 
		L.meanregionalallies L.meanregionalusallies L.spatial_lag L.polity2 L.growth L.lntpop  
		L.IMR war civilwar movav3 movav3_sp L.threat_environment) 
	compress 
	nonotes 
	addnote("Panel-corrected standard errors in parentheses. Two-tailed significance tests used." "$*$ 
		p$\leq$ 0.10; $**$ p$\leq$ 0.05; $***$ p$\leq$0.01") 
		substitute(L.  ) ;		
	
	#delimit cr
	
	
	
	
* Troops >= 20
clear all
set mem 50m
* cd "..."
use "DATA_COMPILED_ATOP_20151118.dta"
set more off 

label var lntroops20 "ln(Troops)"
label var lntroops_spmean20 "ln(Troops Spatial Mean)"
label var interaction20 "Troops $\times$ Troops Spatial Mean"
label var meanregionalallies "Host-State Allies (Spatial Mean)"
label var meanregionalusallies "US Allies (Spatial Mean)"
replace lntroops = 0 if troops<20

xtset ccode year
set more off
eststo clear
#delimit ;
	//	All States
eststo:   xtpcse defenseburden l.lntroops20 l.lntroops_spmean20 l.interaction20 l.spatial_lag l.polity l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar l.meanregionalallies l.meanregionalusallies if year<2004, corr(ar1) pairwise ;	
	// 	Non-NATO US Allies
eststo:   xtpcse defenseburden l.lntroops20 l.lntroops_spmean20 l.interaction20 l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates 
	civilwar l.meanregionalallies l.meanregionalusallies if usally == 1 & NATO == 0 
	& year<2004, corr(ar1) pairwise ;
	//	NATO Allies
eststo:   xtpcse defenseburden l.lntroops20 l.lntroops_spmean20 l.interaction20 l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if NATO == 1 & year<2004, 
	corr(ar1) pairwise;
	// 	Non-US Allies
eststo:   xtpcse defenseburden l.lntroops20 l.lntroops_spmean20 l.interaction20 l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if usally ==0 & year<2004, 
	corr(ar1) pairwise ;

#delimit ;
esttab _all using Appendix_Table_6_20160104.tex, replace 
	mtitles("All States" "Non-NATO Allies" "NATO Allies" "Non-Allies")  
	scalars("p Prob $ > \chi^2$") se(3) b(3) r2 obslast label se nogaps 
	star(* 0.10 ** 0.05 *** 0.01)  
	wide
	nogaps
	order(L.lntroops20 L.lntroops_spmean20 L.interaction20 L.spatial_lag 
		L.meanregionalallies L.meanregionalusallies L.spatial_lag L.polity2 L.growth L.lntpop  
		L.IMR war civilwar movav3 L.threat_environment) 
	compress 
	nonotes 
	addnote("Panel-corrected standard errors in parentheses. Two-tailed significance tests used." "$*$ 
		p$\leq$ 0.10; $**$ p$\leq$ 0.05; $***$ p$\leq$0.01") 
		substitute(L.  ) ;		
	
	#delimit cr
	

	
* Troops >= 100
clear all
set mem 50m
* cd "..."
use "DATA_COMPILED_ATOP_20151118.dta"
set more off 

label var lntroops100 "ln(Troops)"
label var lntroops_spmean100 "ln(Troops Spatial Mean)"
label var interaction100 "Troops $\times$ Troops Spatial Mean"
label var meanregionalallies "Host-State Allies (Spatial Mean)"
label var meanregionalusallies "US Allies (Spatial Mean)"
replace lntroops = 0 if troops<100

xtset ccode year
set more off
eststo clear
#delimit ;
	//	All States
eststo:   xtpcse defenseburden l.lntroops100 l.lntroops_spmean100 l.interaction100 l.spatial_lag l.polity l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar l.meanregionalallies l.meanregionalusallies if  year<2004, corr(ar1) pairwise ;	
	// 	Non-NATO US Allies
eststo:   xtpcse defenseburden l.lntroops100 l.lntroops_spmean100 l.interaction100 l.spatial_lag l.polity
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates 
	civilwar l.meanregionalallies l.meanregionalusallies if usally == 1 & NATO == 0 
	& year<2004, corr(ar1) pairwise ;
	//	NATO Allies
eststo:   xtpcse defenseburden l.lntroops100 l.lntroops_spmean100 l.interaction100 l.spatial_lag l.polity l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if NATO == 1 & year<2004, 
	corr(ar1) pairwise;
	// 	Non-US Allies
eststo:   xtpcse defenseburden l.lntroops100 l.lntroops_spmean100 l.interaction100 l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if usally ==0 & year<2004, 
	corr(ar1) pairwise ;

#delimit ;
esttab _all using Appendix_Table_7_20160104.tex, replace 
	mtitles("All States" "Non-NATO Allies" "NATO Allies" "Non-Allies")  
	scalars("p Prob $ > \chi^2$") se(3) b(3) r2 obslast label se nogaps 
	star(* 0.10 ** 0.05 *** 0.01)  
	wide
	nogaps
	order(L.lntroops100 L.lntroops_spmean100 L.interaction100 L.spatial_lag 
		L.meanregionalallies L.meanregionalusallies L.spatial_lag L.polity2 L.growth L.lntpop  
		L.IMR war civilwar movav3 L.threat_environment) 
	compress 
	nonotes 
	addnote("Panel-corrected standard errors in parentheses. Two-tailed significance tests used." "$*$ 
		p$\leq$ 0.10; $**$ p$\leq$ 0.05; $***$ p$\leq$0.01") 
		substitute(L.  ) ;		
	
	#delimit cr
	
	

* Alignment quartiles
clear all
set mem 50m
* cd "..."
use "DATA_COMPILED_ATOP_20151118.dta"
set more off 

xtset ccode year
set more off
eststo clear

xtset ccode year

xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar l.meanregionalallies l.meanregionalusallies if year<2004 , corr(ar1) pairwise	

sum absidealdiff if e(sample), d
local p25 = r(p25)
local median = r(p50)
local p75 = r(p75)

generate aligned1 = 0
replace aligned1 = 1 if absideal<`p25'
label var aligned1 "< 25th Percentile"
generate aligned2 = 0
replace aligned2 = 1 if absideal<`median' & absideal >`p25'
label var aligned2 "25th–50th Percentile"
generate aligned3 = 0
replace aligned3 = 1 if absideal>`median' & absideal < `p75'
label var aligned3 "50th–75th Percentile"
generate aligned4 = 0
replace aligned4 = 1 if absideal>`p75'
label var aligned4 "> 75th Percentile"

#delimit ;
	//	All States
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar l.meanregionalallies l.meanregionalusallies if aligned1==1, corr(ar1) pairwise ;	
	// 	Non-NATO US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates 
	civilwar l.meanregionalallies l.meanregionalusallies if aligned2==1, corr(ar1) pairwise ;
	//	NATO Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if aligned3==1, 
	corr(ar1) pairwise;
	// 	Non-US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if aligned4==1, 
	corr(ar1) pairwise ;

#delimit ;
esttab _all using Appendix_Table_8_20160104.tex, replace 
	mtitles("$ < 25^{th}$" "$ 25^{th}--50^{th}$" "$ 50^{th}--75^{th}$" "$ > 75^{th}$")  
	scalars("p Prob $ > \chi^2$") se(3) b(3) r2 obslast label se nogaps 
	star(* 0.10 ** 0.05 *** 0.01)  
	wide
	nogaps
	order(L.lntroops L.lntroops_spmean L.interaction L.spatial_lag 
		L.meanregionalallies L.meanregionalusallies L.spatial_lag L.polity2 L.growth L.lntpop  
		L.IMR war civilwar movav3 L.threat_environment) 
	compress 
	nonotes 
	addnote("Panel-corrected standard errors in parentheses. Two-tailed significance tests used." "$*$ 
		p$\leq$ 0.10; $**$ p$\leq$ 0.05; $***$ p$\leq$0.01") 
		substitute(L.  ) ;		
	
	#delimit cr
	
	
	

* 1/GDP test for appendix
clear all
set mem 50m
* cd "..."
use "DATA_COMPILED_ATOP_20151118.dta"
set more off 

label var interaction "Troops $\times$ Troops Spatial Mean"
label var meanregionalallies "Host-State Allies (Spatial Mean)"
label var meanregionalusallies "US Allies (Spatial Mean)"
label var movav3_sp "MIDs (Spatial Mean)"

* 1/GDP test
gen dv = (1/realgdp)*100

xtset ccode year
set more off
eststo clear
#delimit ;
	//	All States
eststo:   xtpcse dv l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity l.growth 
	l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if year<2004 & ccode!=255 & ccode!=260 & ccode!=740, corr(ar1) pairwise ;	
	// 	Non-NATO US Allies
eststo:   xtpcse dv l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates 
	civilwar l.meanregionalallies l.meanregionalusallies if usally == 1 & NATO == 0 
	& year<2004 & ccode!=255 & ccode!=260 & ccode!=740, corr(ar1) pairwise ;
	//	NATO Allies
eststo:   xtpcse dv l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if NATO == 1 & year<2004 & ccode!=255 & ccode!=260 & ccode!=740, 
	corr(ar1) pairwise;
	// 	Non-US Allies
eststo:   xtpcse dv l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if usally ==0 & year<2004 & ccode!=255 & ccode!=260 & ccode!=740, 
	corr(ar1) pairwise ;

#delimit ;
esttab _all using Appendix_Table_9_20160126.tex, replace 
	mtitles("All States" "Non-NATO Allies" "NATO Allies" "Non-Allies")  
	scalars("p Prob $ > \chi^2$") se(3) b(3) r2 obslast label se nogaps 
	star(* 0.10 ** 0.05 *** 0.01)  
	wide
	nogaps
	order(L.lntroops L.lntroops_spmean L.interaction L.spatial_lag 
		L.meanregionalallies L.meanregionalusallies L.spatial_lag L.polity2 L.growth L.lntpop  
		L.IMR war civilwar movav3 L.threat_environment) 
	compress 
	nonotes 
	addnote("Panel-corrected standard errors in parentheses. Two-tailed significance tests used." "$*$ 
		p$\leq$ 0.10; $**$ p$\leq$ 0.05; $***$ p$\leq$0.01") 
		substitute(L.  ) ;		
	
	#delimit cr
	
	
	
* Warsaw Pact
clear all
set mem 50m
* cd "..."
use "DATA_COMPILED_ATOP_20151118.dta"
set more off 

label var interaction "Troops $\times$ Troops Spatial Mean"
label var meanregionalallies "Host-State Allies (Spatial Mean)"
label var meanregionalusallies "US Allies (Spatial Mean)"
label var movav3_sp "MIDs (Spatial Mean)"

xtset ccode year
set more off
eststo clear
#delimit ;
	//	All States
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity l.growth 
	l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if year<2004 , corr(ar1) pairwise ;	
	// 	Non-NATO US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates 
	civilwar l.meanregionalallies l.meanregionalusallies if usally == 1 & NATO == 0 
	& year<2004, corr(ar1) pairwise ;
	//	NATO Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies if NATO == 1 & year<2004 , 
	corr(ar1) pairwise;
	// 	Non-US Allies
eststo:   xtpcse defenseburden l.lntroops l.lntroops_spmean l.interaction l.spatial_lag l.polity 
	l.growth l.lntpop l.IMR l.threat_environment war movav3 borderstates civilwar 
	l.meanregionalallies l.meanregionalusallies l.warsawpact if usally ==0 & year<2004 , 
	corr(ar1) pairwise ;

#delimit ;
esttab _all using Appendix_Table_10_20160408.tex, replace 
	mtitles("All States" "Non-NATO Allies" "NATO Allies" "Non-Allies")  
	scalars("p Prob $ > \chi^2$") se(3) b(3) r2 obslast label se nogaps 
	star(* 0.10 ** 0.05 *** 0.01)  
	wide
	nogaps
	order(L.lntroops L.lntroops_spmean L.interaction L.spatial_lag 
		L.meanregionalallies L.meanregionalusallies L.spatial_lag L.polity2 L.growth L.lntpop  
		L.IMR war civilwar movav3 L.threat_environment L.warsawpact) 
	compress 
	nonotes 
	addnote("Panel-corrected standard errors in parentheses. Two-tailed significance tests used." "$*$ 
		p$\leq$ 0.10; $**$ p$\leq$ 0.05; $***$ p$\leq$0.01") 
		substitute(L.  ) ;		
	
	#delimit cr

